package a.d;

import a.c.q;

public class o
  implements p
{
  private double a;
  private double b;
  private double c;
  private double d;
  private double e;
  private double f;
  private static final byte g = 1;
  private static final byte h = 2;
  private static final byte i = 4;
  private static final byte j = 8;
  public static boolean k;
  
  public o(t paramt)
  {
    this(paramt.d, paramt.e + paramt.b, paramt.a, paramt.b);
  }
  
  public o(o paramo)
  {
    this(paramo.d(), paramo.e(), paramo.g(), paramo.h());
    this.e = paramo.i();
    this.f = paramo.j();
  }
  
  public o(w paramw, s params)
  {
    this(paramw.a, paramw.b, params.a, params.b);
  }
  
  public o(w paramw, s params, z paramz)
  {
    this(paramw.a, paramw.b, params.a, params.b, paramz.a(), paramz.b());
  }
  
  public o(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    this.a = paramDouble1;
    this.b = paramDouble2;
    this.c = paramDouble3;
    this.d = paramDouble4;
    this.e = 0.0D;
    this.f = -1.0D;
  }
  
  public o(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    this(paramDouble1, paramDouble2, paramDouble3, paramDouble4);
    e(paramDouble5, paramDouble6);
  }
  
  public boolean b()
  {
    boolean bool = w.e;
    if (!bool) {
      if (this.c >= 0.0D) {
        if (bool) {
          break label31;
        }
      }
    }
    label31:
    return this.d < 0.0D;
  }
  
  public w c()
  {
    return new w(this.a, this.b);
  }
  
  public void a(w paramw)
  {
    a(paramw.a(), paramw.b());
  }
  
  public void a(double paramDouble1, double paramDouble2)
  {
    this.a = paramDouble1;
    this.b = paramDouble2;
  }
  
  public double d()
  {
    return this.a;
  }
  
  public double e()
  {
    return this.b;
  }
  
  public s f()
  {
    return new s(this.c, this.d);
  }
  
  public void a(s params)
  {
    b(params.a, params.b);
  }
  
  public void b(double paramDouble1, double paramDouble2)
  {
    this.c = paramDouble1;
    this.d = paramDouble2;
  }
  
  public double g()
  {
    return this.c;
  }
  
  public double h()
  {
    return this.d;
  }
  
  public void c(double paramDouble1, double paramDouble2)
  {
    e(paramDouble1, paramDouble2);
  }
  
  private void e(double paramDouble1, double paramDouble2)
  {
    if (paramDouble1 == 0.0D)
    {
      if (paramDouble2 == 0.0D) {
        throw new IllegalArgumentException("Invalid up vector: (0,0).");
      }
      this.e = 0.0D;
      this.f = (paramDouble2 > 0.0D ? 1.0D : -1.0D);
    }
    else if (paramDouble2 == 0.0D)
    {
      this.e = (paramDouble1 > 0.0D ? 1.0D : -1.0D);
      this.f = 0.0D;
    }
    else
    {
      double d1 = Math.sqrt(paramDouble1 * paramDouble1 + paramDouble2 * paramDouble2);
      this.e = (paramDouble1 / d1);
      this.f = (paramDouble2 / d1);
    }
  }
  
  public double i()
  {
    return this.e;
  }
  
  public double j()
  {
    return this.f;
  }
  
  public double k()
  {
    return Math.atan2(-this.e, -this.f);
  }
  
  public void a(double paramDouble)
  {
    this.e = (-Math.sin(paramDouble));
    this.f = (-Math.cos(paramDouble));
  }
  
  public void f(double paramDouble1, double paramDouble2)
  {
    this.a += paramDouble1;
    this.b += paramDouble2;
  }
  
  public w l()
  {
    double d1 = this.d * 0.5D;
    double d2 = this.c * 0.5D;
    double d3 = this.a + this.e * d1 - this.f * d2;
    double d4 = this.b + this.f * d1 + this.e * d2;
    return new w(d3, d4);
  }
  
  public void b(w paramw)
  {
    g(paramw.a(), paramw.b());
  }
  
  public void g(double paramDouble1, double paramDouble2)
  {
    double d1 = this.d * 0.5D;
    double d2 = this.c * 0.5D;
    this.a = (paramDouble1 - this.e * d1 + this.f * d2);
    this.b = (paramDouble2 - this.f * d1 - this.e * d2);
  }
  
  public t a()
  {
    w[] arrayOfw = a(this);
    double d1 = Math.min(Math.min(arrayOfw[0].a, arrayOfw[1].a), Math.min(arrayOfw[2].a, arrayOfw[3].a));
    double d2 = Math.max(Math.max(arrayOfw[0].a, arrayOfw[1].a), Math.max(arrayOfw[2].a, arrayOfw[3].a));
    double d3 = Math.min(Math.min(arrayOfw[0].b, arrayOfw[1].b), Math.min(arrayOfw[2].b, arrayOfw[3].b));
    double d4 = Math.max(Math.max(arrayOfw[0].b, arrayOfw[1].b), Math.max(arrayOfw[2].b, arrayOfw[3].b));
    return new t(d1, d3, d2 - d1, d4 - d3);
  }
  
  public boolean h(double paramDouble1, double paramDouble2)
  {
    return a(paramDouble1, paramDouble2, false);
  }
  
  public boolean a(double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    return a(this, paramDouble1, paramDouble2, 0.0D, paramBoolean);
  }
  
  public static w[] a(o paramo)
  {
    double d1 = paramo.c;
    double d2 = paramo.d;
    double d3 = paramo.a;
    double d4 = paramo.b;
    double d5 = paramo.e;
    double d6 = paramo.f;
    double d7 = d3 + d5 * d2;
    double d8 = d4 + d6 * d2;
    double d9 = d3 + d5 * d2 - d6 * d1;
    double d10 = d4 + d6 * d2 + d5 * d1;
    double d11 = d3 - d6 * d1;
    double d12 = d4 + d5 * d1;
    return new w[] { new w(d3, d4), new w(d7, d8), new w(d9, d10), new w(d11, d12) };
  }
  
  private static t a(t paramt, double paramDouble)
  {
    return new t(paramt.d - paramDouble, paramt.e - paramDouble, paramt.a + 2.0D * paramDouble, paramt.b + 2.0D * paramDouble);
  }
  
  private static boolean a(t paramt, double paramDouble1, double paramDouble2, double paramDouble3)
  {
    t localt = paramt;
    if (!w.e) {
      if (paramDouble3 > 0.0D) {
        localt = a(paramt, paramDouble3);
      }
    }
    return localt.a(paramDouble1, paramDouble2);
  }
  
  private static boolean a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, t paramt, double paramDouble5)
  {
    t localt = paramt;
    if (paramDouble5 > 0.0D) {
      localt = a(paramt, paramDouble5);
    }
    n localn = new n(new w(paramDouble1, paramDouble2), new w(paramDouble3, paramDouble4));
    return localn.a(localt);
  }
  
  public static boolean a(o paramo, t paramt, double paramDouble)
  {
    boolean bool = w.e;
    if (!bool) {
      if (paramt.a >= 0.0D)
      {
        if (bool) {
          break label39;
        }
        if (paramt.b >= 0.0D) {
          break label35;
        }
      }
    }
    return false;
    label35:
    label39:
    double d1 = paramo.a;
    double d2 = paramo.b;
    double d3 = paramo.c;
    double d4 = paramo.d;
    if (!bool) {
      if (d3 >= 0.0D)
      {
        if (bool) {
          break label94;
        }
        if (d4 >= 0.0D) {
          break label85;
        }
      }
    }
    return false;
    label85:
    label94:
    if (!bool)
    {
      if (a(paramt, d1, d2, paramDouble)) {
        return true;
      }
      if (bool) {}
    }
    else if (paramo.m())
    {
      localObject = new t(d1 - paramDouble, d2 - d4 - paramDouble, d3 + 2.0D * paramDouble, d4 + 2.0D * paramDouble);
      return t.a(paramt, (t)localObject);
    }
    Object localObject = a(paramo);
    if (!bool) {
      if (a(localObject[0].a, localObject[0].b, localObject[1].a, localObject[1].b, paramt, paramDouble)) {
        return true;
      }
    }
    if (!bool) {
      if (a(localObject[1].a, localObject[1].b, localObject[2].a, localObject[2].b, paramt, paramDouble)) {
        return true;
      }
    }
    if (!bool) {
      if (a(localObject[2].a, localObject[2].b, localObject[3].a, localObject[3].b, paramt, paramDouble)) {
        return true;
      }
    }
    if (!bool) {
      if (a(localObject[3].a, localObject[3].b, localObject[0].a, localObject[0].b, paramt, paramDouble)) {
        return true;
      }
    }
    return false;
  }
  
  private boolean m()
  {
    boolean bool = w.e;
    if ((bool) || (this.e == 0.0D)) {
      if (bool) {}
    }
    return this.f == -1.0D;
  }
  
  public static boolean a(o paramo, w paramw, double paramDouble)
  {
    return a(paramo, paramw.a, paramw.b, paramDouble);
  }
  
  public static boolean a(o paramo, double paramDouble1, double paramDouble2, double paramDouble3)
  {
    return a(paramo, paramDouble1, paramDouble2, paramDouble3, false);
  }
  
  private static boolean a(o paramo, double paramDouble1, double paramDouble2, double paramDouble3, boolean paramBoolean)
  {
    boolean bool = w.e;
    double d1 = paramo.e;
    double d2 = paramo.f;
    if (!bool) {
      if (paramo.m()) {
        return t.a(paramo.a - paramDouble3, paramo.b - paramo.d - paramDouble3, paramo.c + 2.0D * paramDouble3, paramo.d + 2.0D * paramDouble3, paramDouble1, paramDouble2, paramBoolean);
      }
    }
    double d3 = paramo.a;
    double d4 = paramo.b;
    double d5 = paramo.c;
    double d6 = paramo.d;
    if (!bool) {
      if (d5 >= 0.0D)
      {
        if (bool) {
          break label131;
        }
        if (d6 >= 0.0D) {
          break label128;
        }
      }
    }
    return false;
    label128:
    label131:
    double d7 = paramDouble1 - d3;
    double d8 = paramDouble2 - d4;
    double d9 = d5 + d6 + paramDouble3;
    if (!bool) {
      if (d7 >= -d9)
      {
        if (bool) {
          break label205;
        }
        if (d7 <= d9)
        {
          if (bool) {
            break label205;
          }
          if (d8 >= -d9)
          {
            if (bool) {
              break label217;
            }
            if (d8 <= d9) {
              break label206;
            }
          }
        }
      }
    }
    label205:
    return false;
    label206:
    label217:
    double d10 = d7 * -d2 + d8 * d1;
    double d11 = d7 * d1 + d8 * d2;
    return t.a(0.0D - paramDouble3, 0.0D - paramDouble3, d5 + 2.0D * paramDouble3, d6 + 2.0D * paramDouble3, d10, d11, paramBoolean);
  }
  
  public static boolean a(o paramo1, o paramo2, double paramDouble)
  {
    boolean bool = w.e;
    w[] arrayOfw = a(paramo2);
    if (((bool) || (a(paramo1, arrayOfw[0], paramDouble))) && ((bool) || (a(paramo1, arrayOfw[1], paramDouble))) && ((bool) || (a(paramo1, arrayOfw[2], paramDouble)))) {
      if (bool) {}
    }
    return a(paramo1, arrayOfw[3], paramDouble);
  }
  
  public static boolean a(o paramo, n paramn, double paramDouble)
  {
    boolean bool = w.e;
    double d1 = paramo.e;
    double d2 = paramo.f;
    if (!bool) {
      if (paramo.m())
      {
        t localt1 = new t(paramo.a - paramDouble, paramo.b - paramo.d - paramDouble, paramo.c + 2.0D * paramDouble, paramo.d + 2.0D * paramDouble);
        return paramn.a(localt1);
      }
    }
    double d3 = paramo.a;
    double d4 = paramo.b;
    double d5 = paramo.c;
    double d6 = paramo.d;
    if (!bool) {
      if (d5 >= 0.0D)
      {
        if (bool) {
          break label139;
        }
        if (d6 >= 0.0D) {
          break label132;
        }
      }
    }
    return false;
    label132:
    label139:
    double d7 = paramn.d().a;
    double d8 = paramn.d().b;
    double d9 = paramn.e().a;
    double d10 = paramn.e().b;
    d7 -= d3;
    d8 -= d4;
    d9 -= d3;
    d10 -= d4;
    double d11 = d7 * -d2 + d8 * d1;
    double d12 = d7 * d1 + d8 * d2;
    double d13 = d9 * -d2 + d10 * d1;
    double d14 = d9 * d1 + d10 * d2;
    t localt2 = new t(0.0D - paramDouble, 0.0D - paramDouble, d5 + 2.0D * paramDouble, d6 + 2.0D * paramDouble);
    n localn = new n(new w(d11, d12), new w(d13, d14));
    return localn.a(localt2);
  }
  
  public static w b(o paramo, n paramn, double paramDouble)
  {
    boolean bool = w.e;
    double d1 = paramo.e;
    double d2 = paramo.f;
    double d3 = paramn.d().a;
    double d4 = paramn.d().b;
    double d5 = paramn.e().a;
    double d6 = paramn.e().b;
    if (!bool) {
      if (paramo.m())
      {
        t localt1 = new t(paramo.a - paramDouble, paramo.b - paramo.d - paramDouble, paramo.c + 2.0D * paramDouble, paramo.d + 2.0D * paramDouble);
        return a(localt1, d3, d4, d5, d6);
      }
    }
    double d7 = paramo.a;
    double d8 = paramo.b;
    double d9 = paramo.c;
    double d10 = paramo.d;
    if (!bool)
    {
      if (d9 >= 0.0D) {
        if (bool) {
          break label214;
        }
      }
    }
    else {
      if (d10 >= 0.0D) {
        break label175;
      }
    }
    return null;
    label175:
    d3 -= d7;
    d4 -= d8;
    d5 -= d7;
    d6 -= d8;
    label214:
    double d11 = d3 * -d2 + d4 * d1;
    double d12 = d3 * d1 + d4 * d2;
    double d13 = d5 * -d2 + d6 * d1;
    double d14 = d5 * d1 + d6 * d2;
    t localt2 = new t(0.0D - paramDouble, 0.0D - paramDouble, d9 + 2.0D * paramDouble, d10 + 2.0D * paramDouble);
    w localw = a(localt2, d11, d12, d13, d14);
    if (localw != null)
    {
      double d15 = d7 + localw.a * -d2 + localw.b * d1;
      double d16 = d8 + localw.a * d1 + localw.b * d2;
      return new w(d15, d16);
    }
    return null;
  }
  
  private static boolean a(int paramInt1, int paramInt2)
  {
    if (!w.e) {}
    return (paramInt1 & paramInt2) != 0;
  }
  
  private static boolean c(int paramInt1, int paramInt2)
  {
    if (!w.e) {}
    return (paramInt1 | paramInt2) == 0;
  }
  
  private static boolean e(int paramInt1, int paramInt2)
  {
    boolean bool = w.e;
    if (!bool) {
      if (!a(paramInt1, paramInt2)) {
        if (bool) {
          break label29;
        }
      }
    }
    label29:
    return c(paramInt1, paramInt2);
  }
  
  private static final w a(t paramt, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    double d1 = paramt.d();
    double d2 = paramt.e();
    double d3 = d1 + paramt.b();
    double d4 = d2 + paramt.c();
    int m = a(d1, d2, d3, d4, paramDouble1, paramDouble2);
    int n = a(d1, d2, d3, d4, paramDouble3, paramDouble4);
    int i1 = 0;
    int i2 = 0;
    int i3 = 10;
    label210:
    label242:
    do
    {
      do
      {
        if (e(m, n)) {
          break label366;
        }
        if (bool1) {
          break label373;
        }
        if (i3 <= 0) {
          break label366;
        }
        i3--;
        if (bool2) {
          break label242;
        }
        if (m == 0) {
          break;
        }
        if (!bool2) {
          if ((m & 0x3) != 0)
          {
            d5 = (m & 0x2) != 0 ? d3 : d1;
            paramDouble2 += (d5 - paramDouble1) * (paramDouble4 - paramDouble2) / (paramDouble3 - paramDouble1);
            paramDouble1 = d5;
            if (bool2) {
              continue;
            }
            if (!bool1) {
              break label210;
            }
          }
        }
        d5 = (m & 0x8) != 0 ? d4 : d2;
        paramDouble1 += (d5 - paramDouble2) * (paramDouble3 - paramDouble1) / (paramDouble4 - paramDouble2);
        paramDouble2 = d5;
        i1 = 1;
        m = a(d1, d2, d3, d4, paramDouble1, paramDouble2);
      } while ((!bool2) && (!bool1));
      if (!bool2) {
        if ((n & 0x3) != 0)
        {
          d5 = (n & 0x2) != 0 ? d3 : d1;
          paramDouble4 += (d5 - paramDouble3) * (paramDouble4 - paramDouble2) / (paramDouble3 - paramDouble1);
          paramDouble3 = d5;
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break label341;
          }
        }
      }
      double d5 = (n & 0x8) != 0 ? d4 : d2;
      paramDouble3 += (d5 - paramDouble4) * (paramDouble3 - paramDouble1) / (paramDouble4 - paramDouble2);
      paramDouble4 = d5;
      i2 = 1;
      n = a(d1, d2, d3, d4, paramDouble3, paramDouble4);
    } while (!bool1);
    label341:
    label366:
    if ((!bool2) && (i3 == 0)) {
      label373:
      return null;
    }
    if (!bool2) {
      if (a(m, n)) {
        return null;
      }
    }
    if (!bool2) {
      if (i1 == 0)
      {
        if (bool2) {
          break label419;
        }
        if (i2 == 0) {
          return null;
        }
      }
    }
    if (i1 != 0) {
      label419:
      return new w(paramDouble1, paramDouble2);
    }
    return new w(paramDouble3, paramDouble4);
  }
  
  private static byte a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    byte b1 = 0;
    if (!bool2) {
      if (paramDouble5 < paramDouble1)
      {
        b1 = 1;
        if (bool2) {
          break label58;
        }
        if (!bool1) {
          break label54;
        }
      }
    }
    if (!bool2) {
      if (paramDouble5 > paramDouble3) {
        b1 = 2;
      }
    }
    label54:
    label58:
    if (!bool2) {
      if (paramDouble6 < paramDouble2)
      {
        b1 = (byte)(b1 | 0x4);
        if (bool2) {
          break label106;
        }
        if (!bool1) {
          break label104;
        }
      }
    }
    if (!bool2) {
      if (paramDouble6 > paramDouble4) {
        b1 = (byte)(b1 | 0x8);
      }
    }
    label104:
    label106:
    return b1;
  }
  
  public String toString()
  {
    return getClass().getName() + "[anchorX=" + this.a + ";anchorY=" + this.b + ";width=" + this.c + ";height=" + this.d + ";upX=" + this.e + ";upY=" + this.f + "]";
  }
  
  private static int i(double paramDouble1, double paramDouble2)
  {
    return u.a(paramDouble1, paramDouble2);
  }
  
  public boolean equals(Object paramObject)
  {
    boolean bool = w.e;
    if (!bool) {
      if (this == paramObject) {
        return true;
      }
    }
    if (paramObject != null)
    {
      if (bool) {
        break label37;
      }
      if (getClass() == paramObject.getClass()) {}
    }
    else
    {
      return false;
    }
    label37:
    o localo = (o)paramObject;
    if (!bool) {
      if (i(localo.a, this.a) != 0) {
        return false;
      }
    }
    if (!bool) {
      if (i(localo.b, this.b) != 0) {
        return false;
      }
    }
    if (!bool) {
      if (i(localo.d, this.d) != 0) {
        return false;
      }
    }
    if (!bool) {
      if (i(localo.c, this.c) != 0) {
        return false;
      }
    }
    if (!bool) {
      if (i(localo.e, this.e) != 0) {
        return false;
      }
    }
    if (!bool) {
      if (i(localo.f, this.f) != 0) {
        return false;
      }
    }
    return true;
  }
  
  public int hashCode()
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    int m = super.hashCode();
    long l = (bool2) || (this.a != 0.0D) ? Double.doubleToLongBits(this.a) : 0L;
    m = 31 * m + (int)(l ^ l >>> 32);
    l = (bool2) || (this.b != 0.0D) ? Double.doubleToLongBits(this.b) : 0L;
    m = 31 * m + (int)(l ^ l >>> 32);
    l = (bool2) || (this.e != 0.0D) ? Double.doubleToLongBits(this.e) : 0L;
    m = 31 * m + (int)(l ^ l >>> 32);
    l = (bool2) || (this.f != 0.0D) ? Double.doubleToLongBits(this.f) : 0L;
    m = 31 * m + (int)(l ^ l >>> 32);
    l = (bool2) || (this.c != 0.0D) ? Double.doubleToLongBits(this.c) : 0L;
    m = 31 * m + (int)(l ^ l >>> 32);
    l = (bool2) || (this.d != 0.0D) ? Double.doubleToLongBits(this.d) : 0L;
    m = 31 * m + (int)(l ^ l >>> 32);
    if ((bool2) || (q.n))
    {
      if (!bool2) {}
      w.d = !bool1;
    }
    if (q.o) {
      w.e = !bool2;
    }
    return m;
  }
  
  public o j(double paramDouble1, double paramDouble2)
  {
    return new o(this.a + paramDouble1, this.b + paramDouble2, this.c, this.d, this.e, this.f);
  }
  
  public o k(double paramDouble1, double paramDouble2)
  {
    return new o(this.a, this.b, paramDouble1, paramDouble2, this.e, this.f);
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.d.o
 * JD-Core Version:    0.7.0.1
 */